import dva from './utils/dva';
import logger from 'redux-logger';

import * as Model from './models/**.js'

const model = [];
for (const key in Model) {
    if (Model.hasOwnProperty(key)) {
        const value = Model[key];
        model.push(value)
    }
}

const middleware = [logger];
const store = dva({
    initialState: {},
    models: model,
    onAction: middleware,
    onError(e) {
        console.log('onError', e);
    },
});


export default store
